package com.sijibao.gather.event.serialization;

import com.sijibao.gather.event.StockSearchEvent;

public class StockSearchEventSerializer extends CommonSerializer implements Serializer<StockSearchEvent>
{
	/**
	 * 序列化顺序
	 * 用户编码<br>
	 * 搜索起点<br>
	 * 搜索终点<br>
	 * 搜索时间<br>
	 * 货箱结构<br>
	 * 车长<br>
	 * 货物类型<br>
	 * 定位经度<br>
	 * 定位纬度<br>
	 * 客户端版本<br>
	 * 手机型号<br>
	 * 设备号<br>
	 */
	public String serialize(StockSearchEvent event)
	{
		StringBuilder sb=new StringBuilder();
		sb.append(stringSerialize(event.getUserCode()));
		sb.append(SEPARATOR);
		sb.append(stringSerialize(event.getSourceRegionCode()));
		sb.append(SEPARATOR);
		sb.append(stringSerialize(event.getTargetRegionCode()));
		sb.append(SEPARATOR);
		sb.append(timestampMsSerialize(event.getSearchTime()));
		sb.append(SEPARATOR);
		sb.append(stringSerialize(event.getVehicleConstructs()));
		sb.append(SEPARATOR);
		sb.append(stringSerialize(event.getVehicleLengths()));
		sb.append(SEPARATOR);
		sb.append(stringSerialize(event.getStockKinds()));
		sb.append(SEPARATOR);
		sb.append(doubleSerialize(event.getLongitude()));
		sb.append(SEPARATOR);
		sb.append(doubleSerialize(event.getLatitude()));
		sb.append(SEPARATOR);
		sb.append(event.getClientVersion());
		sb.append(SEPARATOR);
		sb.append(stringSerialize(event.getMobileModel()));
		sb.append(SEPARATOR);
		sb.append(stringSerialize(event.getDeviceCode()));
		return sb.toString();
	}

}
